<template>
    <div>   
        <h1>这是Vue3的写法</h1>
        <p>这是按钮:<button @click="thisIsBtn">按钮</button></p>
        <p>Count:{{count}}</p>
    </div>
</template>

<script lang="ts">
import {defineComponent,ref,getCurrentInstance} from 'vue'
export default defineComponent({
    setup(){
        const instance  = getCurrentInstance().appContext.config.globalProperties
        console.info(instance)
        let count = ref('2021')
        const thisIsBtn = () =>{
            count.value = '123'
        }

        return{
            count,
            thisIsBtn
        }

    }
})
</script>

<style lang="scss" scoped>
</style>